import { GSprite } from "../../../../com/mui/controls/GSprite";
import { ObjCreate } from "../common/ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { Cache } from "../../cache/Cache";
import { GTextFiled } from "../../../../com/mui/controls/GTextFiled";
//class MoneyPanel
    
    export  class MoneyPanel extends GSprite
    {
        constructor()
        {
            super();
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=ObjCreate.createBitmap(ImagesConst.spiritCoin, 0, 0, this);
            var loc2=ObjCreate.createBitmap(ImagesConst.Tongqian_small, 120, 2, this);
            var loc3=ObjCreate.createBitmap(ImagesConst.Tongqian_bind_small, 240, 2, this);
            this._spiritTxt = ObjCreate.createGTextField("", 25, 0, 100, 20, this, GlobalStyle.textFormat6);
            this._coinTxt = ObjCreate.createGTextField("", 140, 0, 80, 20, this, GlobalStyle.textFormat6);
            this._coinBind = ObjCreate.createGTextField("", 260, 0, 80, 20, this, GlobalStyle.textFormat6);
            return;
        }

        public updateMoney(): void
        {
            this._spiritTxt.text = Cache.instance.role.money.spiritCoin + "";
            this._coinTxt.text = Cache.instance.role.money.coin + "";
            this._coinBind.text = Cache.instance.role.money.coinBind + "";
            return;
        }

        /* internal */ /* var */_spiritTxt: GTextFiled;

        /* internal */ /* var */_coinTxt: GTextFiled;

        /* internal */ /* var */_coinBind: GTextFiled;
    }
